<template>
  <div class="service-express">
    <div class="none" v-if="!express.Success || !express.Traces || express.Traces.length === 0">查询不到相关信息</div>
    <ul v-else class="info">
      <li v-for="(item, index) in express.Traces" :key="index">
        <span class="time">时间: {{item.AcceptTime}}</span>
        <span class="info">信息: {{item.AcceptStation}}</span>
      </li>
    </ul>
  </div>
</template>

<script>
import api from '@/api'
import base64 from '@/util/base64'
export default {
  name: 'ServiceExpress',
  data() {
    return {
      express: {}
    }
  },
  methods: {
    fetchData() {
      api.My.express({
        logistics_id: this.$route.params.logistics_id
      }).then(response => {
        let { data } = response
        data = base64.parse(data)
        console.log(data)
        this.express = JSON.parse(data.express)
      })
    }
  },
  mounted() {
    this.fetchData()
  }
}
</script>

<style scoped lang="stylus">
.service-express
  .info
    li
      margin-bottom 10px
      text-align left
      padding 0 10px
      span
        display block
        //height 20px
        line-height 20px
</style>
